package besta.moon.engine.table;

import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;

import besta.moon.engine.View;

public final class TableViewMap {

    private final HashMap<Object, View> map = new HashMap<>();

    private Object getUniqueKey(String name) {
        return name.toUpperCase(Locale.US); 
    }

    public View get(String name) {
        return (View) map.get(getUniqueKey(name));
    }

    public void put(String name, View tableView) {
        map.put(getUniqueKey(name), tableView);
    }

    public View remove(String name) {
        return (View) map.remove(getUniqueKey(name));
    }

    public Collection<View> values() {
        return map.values();
    }
}
